AIChat: popup and chat default configuration#33225
AIChat: popup and chat default configuration#33225anna-shakhova merged 5 commits intoDevExpress:26_1from
Conversation
cd8e2d2 to
ccf3cce
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the DataGrid AI Assistant integration by introducing default Popup/Chat configuration, exposing additional styling hooks for the Chat empty view, and wiring option-change handling so aiAssistant.popup / aiAssistant.chat updates can be applied at runtime.
Changes:
- Export Chat MessageList empty-view CSS class constants and use them to build a localized empty view template in
AIChat. - Add default Popup/Chat options (including a clear-chat toolbar button) and support updating Popup/Chat options via
AIChat.updateOptions. - Introduce
aiAssistantoption-change helpers + Jest tests, and update AI Assistant view/controller logic to react to option changes.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/ui/chat/messagelist.ts | Exports empty-view CSS class constants for reuse by AI Chat integration. |
| packages/devextreme/js/__internal/grids/grid_core/m_types.ts | Extends aiAssistant options typing with popup/chat option bags. |
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/types.ts | Simplifies AIChatOptions to rely on popupOptions/chatOptions rather than bespoke callbacks. |
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/const.ts | Introduces default Popup/Chat options and the clear-chat icon constant. |
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.ts | Builds default chat config (empty view template), adds clear button, and supports option updates. |
| packages/devextreme/js/__internal/grids/grid_core/ai_chat/ai_chat.test.ts | Updates/extends tests for clear button presence and updateOptions behavior. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/utils.ts | Adds helpers to detect which aiAssistant.* options changed. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/const.ts | Adds AI Assistant popup offset constant. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts | Creates Popup/Chat option objects, message store, and handles aiAssistant option changes. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view_controller.ts | Syncs toolbar item and active state based on AI Assistant visibility and option changes. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/utils.test.ts | Adds Jest coverage for option-change helper predicates. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view.test.ts | Updates tests for new Popup/Chat config wiring and optionChanged behavior. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/tests/ai_assistant_view_controller.test.ts | Updates tests for subscription behavior and enabled/title option handling. |
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view_controller.ts
Outdated
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view_controller.ts
Show resolved
Hide resolved
1bc3374 to
bfffd55
Compare
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme-scss/scss/widgets/base/gridBase/layout/ai-chat/_mixins.scss
Outdated
Show resolved
Hide resolved
b84ac8b to
e3e72b8
Compare
e3e72b8 to
b643745
Compare
packages/devextreme/js/__internal/grids/grid_core/ai_assistant/ai_assistant_view.ts
Show resolved
Hide resolved
packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss
Outdated
Show resolved
Hide resolved
packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss
Outdated
Show resolved
Hide resolved
packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss
Outdated
Show resolved
Hide resolved
b643745 to
afc9abe
Compare
| return { | ||
| ...DEFAULT_CHAT_OPTIONS, | ||
| emptyViewTemplate: (_data, container): void => { | ||
| const $image = $('<div>') |
There was a problem hiding this comment.
Can we extract everything related to the DOM into a separate file – dom.ts? (For example, as it is implemented in sticky_columns)
There was a problem hiding this comment.
Currently there is not so much DOM related code in class, lets do it later if we see it is needed (after messageTemplate for example)
| }; | ||
| } | ||
|
|
||
| public updateOptions(options: AIChatOptions, updatePopup: boolean, updateChat: boolean): void { |
There was a problem hiding this comment.
Minor: rename updatePopup -> needToUpdatePopup, updateChat -> needToUpdateChat
There was a problem hiding this comment.
lets fix it in next PR
No description provided.